// 新增行事件
function addRow(e) {
	var btid = e.source.id;//addbt_
	var grid = mini.get(btid.substring(6));
	var row = {};
	grid.addRow(row);
    grid.beginEditCell(row, 0);
} 
// 删除
function delRow(e){
	var btid = e.source.id;//delbt_
	var grid = mini.get(btid.substring(6));
	var rows = grid.getSelecteds();
	for(var i=0; i<rows.length;i++){
		 grid.removeRow(rows[i]);
	}
}
//编辑开始前发生 id:表格id, name:表单name
function  onCellbeginedit(id,name){
	setTimeout("test('"+id+"','"+name+"')",1000);
}

function test(id,name){
	var grid = mini.get(id);
	 grid.on("cellbeginedit", function (e) {
		    if (e.field == "linkurl") {
		        var row = e.record;
		        var editor = e.editor;
		        var enabled = row.gender == "5" ? true : false;
		   	  editor.setEnabled(enabled);
		    }
	});
}


